package business;

import model.*;
import dbAccess.*;
import exceptions.*;

public class LoginManager {
	private MembreComiteManager membComMan = new MembreComiteManager();
	private AppSettingsManager appSetMan = new AppSettingsManager();
	public MembreComite identification(String userLogin, String userPass, ConnectionSettings connSet) throws PasIdentificationException, BadPasswordException, DatabaseErrorException, BadLoginException, ErreurIdentification, ODBCErrorException, InvalidDataException{
		if(userLogin==null || userPass==null) throw new InvalidDataException();
		DBConnexionSingleton.identification(connSet);
		MembreComite user = membComMan.identification(userLogin, userPass);
		AppSettings.setSettings(appSetMan.loadAppSettings());
		return user;
	}
	
}
